#!/bin/sh
source /etc/profile
name=euxrtb
echo "start to deploy $name"
echo "enter into workspace, " `pwd`
cd /opt/adn-xrtb/
git pull

datetime=`date +%Y%m%d%H%M%S`
echo $datetime


pid=`netstat -nlp | grep :20080 | awk '{print $7}' | awk -F"/" '{ print $1 }'`
echo $pid
kill  $pid
sleep 10s
kill  -9 $pid

mvn clean install -Dmaven.test.skip=true
`mv ./target/xrtb*.jar  ./bin/$name.jar`
java -server  -Xmx4g -XX:MetaspaceSize=256m  -jar "bin/$name.jar"  --spring.profiles.active=prodeu  -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 &
echo "$name service is up..."
#2 0 * * *  bash -x /opt/xrtb/starteu.sh >>rtb.log